<?php
class FileAuthDone extends Action {
	/* (non-PHPdoc)
	 * @see Action::execute()
	 */
	public function execute($params) {
		PluginManager::enabled ( 'cn.usephp.filemgr');
		$me = check_login ( ADMIN_LOGIN_PAGE );
		$data = array ('success' => false );
		$fs_password = rqst ( 'fs_password' );
		$fs_username = rqst ( 'fs_username' );
		if (! empty ( $fs_password ) || ! empty ( $fs_username )) {
			sess_add ( 'fs_username', $fs_username );
			sess_add ( 'fs_password', $fs_password );
			$fs = getFileSystem ();
			if ($fs) {
				$data ['success'] = true;
			}
		}
		return new JsonView ( $data );
	}
}